import httpInstance from "@/utils/http.js";
// 获取购物车菜品
export const getTableOrderDishList = (params) =>
    httpInstance({
        url: `/user/order/shopCart//${params.tableId}`,
        method: 'GET',
        params
    })

// 最近订单和历史订单
export const queryOrderUserPage = (params) => {
    return httpInstance({
        url: '/user/order/userPage',
        method: 'GET',
        params
    })
}


// 用户下单
export const submitOrderSubmit = (params) => {
    return httpInstance({
        url: '/user/order/submit',
        method: 'POST',
        data:params
    })
}

// 再来一单
export const oneOrderAgain = (params) => {
    return httpInstance({
        url: '/user/order/again',
        method: 'POST',
        params
    })
}

// 历史订单
export const getOrderPage = (params) => {
    return httpInstance({
        url: '/user/order/historyOrders',
        method: 'GET',
        params
    })
}

// 订单详情
export const getOrderDetail = (params) =>
    httpInstance({
        url: `/user/order/orderDetail/${params}`,
        method: 'GET'
    })
// 取消订单
export const cancelOrder = (params) =>
    httpInstance({
        url: `/user/order/cancel/${params}`,
        method: 'PUT'
    })
// 催单
export const reminderOrder = (params) =>
    httpInstance({
        url: `/user/order/reminder/${params}`,
        method: 'GET'
    })
// 订单支付
export const paymentOrder = (params) =>
    httpInstance({
        url: `/user/order/alipayment`,
        method: 'PUT',
        data:params
    })
// 再来一单
export const repetitionOrder = (params) =>
    httpInstance({
        url: `/user/order/repetition/${params}`,
        method: 'POST',
        params
    })
// 获取用户送餐期望时间
export const getEstimatedDeliveryTime = (params) =>
    httpInstance({
        url: `/user/order/getEstimatedDeliveryTime`,
        method: 'get',
        params
    })
// 查询用户订单支付状态列表信息
export const queryOrdersCheckStatus = (params) =>
    httpInstance({
        url: `/user/order/queryOrdersCheckStatus`,
        method: 'get',
        params
    })

// 查询用户订单支付状态列表信息
export const orderDetail = (params) =>
    httpInstance({
        url: `/user/order/orderDetail/${params}`,
        method: 'get',

    })

